﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CreateUser.aspx.cs" Inherits="CreateUser" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>注册新账户</title>
     <link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" EmailRegularExpressionErrorMessage="电子邮件格式不正确。" OnCreatedUser="CreateUserWizard1_CreatedUser" InvalidPasswordErrorMessage="密码最短长度为 {0}，其中必须包含非字母数字的字符。">
            <WizardSteps>
                <asp:CreateUserWizardStep runat="server">
                </asp:CreateUserWizardStep>
                <asp:TemplatedWizardStep runat="server" StepType="Finish" Title="详细信息">
                    <ContentTemplate>
                        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="User_ID"
                        DataSourceID="SqlDataSource1" DefaultMode="Edit" Height="50px" Width="600px" HeaderText="详细信息" OnItemUpdated="DetailsView1_ItemUpdated" >
                            <Fields>
                                <asp:BoundField DataField="User_ID" HeaderText="用户名:" ReadOnly="True" SortExpression="User_ID" />
                                <asp:BoundField DataField="User_Name" HeaderText="真实姓名:" SortExpression="User_Name" />
                                <asp:TemplateField HeaderText="性别:" SortExpression="User_Sex">
                                    <EditItemTemplate>
                                        <asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal"
                                        SelectedValue='<%# Bind("User_Sex") %>'>
                                            <asp:ListItem Value="M">男</asp:ListItem>
                                            <asp:ListItem Value="F">女</asp:ListItem>
                                        </asp:RadioButtonList>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="学校:" SortExpression="User_School">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("User_School") %>' Width="219px"></asp:TextBox>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="User_College" HeaderText="学院:" SortExpression="User_College" />
                                <asp:BoundField DataField="User_Deparment" HeaderText="部门:" SortExpression="User_Deparment" />
                                <asp:BoundField DataField="User_TeacherNo" HeaderText="教工号:" SortExpression="User_TeacherNo" />
                                <asp:TemplateField HeaderText="E-Mail:" SortExpression="User_Email">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("User_Email") %>' Width="213px"></asp:TextBox>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="User_TelMobile" HeaderText="手机:" SortExpression="User_TelMobile" />
                                <asp:BoundField DataField="User_TelHome" HeaderText="住宅电话:" SortExpression="User_TelHome" />
                                <asp:BoundField DataField="User_Province" HeaderText="省份:" SortExpression="User_Province" />
                                <asp:BoundField DataField="User_City" HeaderText="城市:" SortExpression="User_City" />
                                <asp:TemplateField HeaderText="详细地址:" SortExpression="User_Address">
                                    <EditItemTemplate>
                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("User_Address") %>' Width="222px"></asp:TextBox>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:ButtonField ButtonType="Button" CommandName="Update" Text="完成" >
                                    <ItemStyle HorizontalAlign="Right" />
                                </asp:ButtonField>
                            </Fields>
                            <HeaderStyle CssClass="table_header" />
                            <FieldHeaderStyle CssClass="table_fieldheader" />
                        </asp:DetailsView>
                    </ContentTemplate>
                    <CustomNavigationTemplate>
                        &nbsp;
                    </CustomNavigationTemplate>
                </asp:TemplatedWizardStep>
                <asp:CompleteWizardStep runat="server">
                    <ContentTemplate>
                        <table border="0">
                            <tr>
                                <td align="center" colspan="2">
                                    完成</td>
                            </tr>
                            <tr>
                                <td>
                                    已成功创建您的帐户。</td>
                            </tr>
                            <tr>
                                <td align="right" colspan="2">
                                    <asp:Button ID="ContinueButton" runat="server" CausesValidation="False" CommandName="Continue"
                                        Text="继续" ValidationGroup="CreateUserWizard1" />
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:CompleteWizardStep>
            </WizardSteps>
           
        </asp:CreateUserWizard>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Jxzy_Database %>"
            SelectCommand="SELECT [User_Name], [User_School], [User_College], [User_Deparment], [User_TeacherNo], [User_Email], [User_Sex], [User_TelMobile], [User_TelHome], [User_Province], [User_City], [User_Address], [User_ID] FROM [zyk_Users] WHERE ([User_ID] = @User_ID)" UpdateCommand="UPDATE [zyk_Users] SET [User_Name] = @User_Name, [User_School] = @User_School, [User_College] = @User_College, [User_Deparment] = @User_Deparment, [User_TeacherNo] = @User_TeacherNo, [User_Email] = @User_Email, [User_Sex] = @User_Sex, [User_TelMobile] = @User_TelMobile, [User_TelHome] = @User_TelHome, [User_Province] = @User_Province, [User_City] = @User_City, [User_Address] = @User_Address WHERE [User_ID] = @User_ID">
            <SelectParameters>
                <asp:Parameter DefaultValue="@#$$!@#" Name="User_ID" Type="String" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="User_Name" Type="String" />
                <asp:Parameter Name="User_School" Type="String" />
                <asp:Parameter Name="User_College" Type="String" />
                <asp:Parameter Name="User_Deparment" Type="String" />
                <asp:Parameter Name="User_TeacherNo" Type="String" />
                <asp:Parameter Name="User_Email" Type="String" />
                <asp:Parameter Name="User_Sex" Type="String" />
                <asp:Parameter Name="User_TelMobile" Type="String" />
                <asp:Parameter Name="User_TelHome" Type="String" />
                <asp:Parameter Name="User_Province" Type="String" />
                <asp:Parameter Name="User_City" Type="String" />
                <asp:Parameter Name="User_Address" Type="String" />
                <asp:Parameter Name="User_ID" Type="String" />
            </UpdateParameters>
        </asp:SqlDataSource>
        </div>
    </form>
</body>
</html>
